/*
 * nseq.cpp
 *
 *  Created on: Oct 28, 2013
 *      Author: m
 */

#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include "CPrinter.h"
#include "Sequence.h"

using namespace ipc;

#define BASE_FILE "/tmp/mynsq"
#define NSEQ_KEY 'a'

int main (void)
{
    int id;

    srand( time( NULL ) );

    sleep( random() % 20 );

    Sequence nsq = Sequence::get( BASE_FILE, NSEQ_KEY );

    id = nsq.getNext();

    CPrinter::setHeader( "NSQ", id );

    CPrinter::printOut( "Obtuve el numero: %d", id );

    return 0;
}
